package com.xyzwps.orm.util;

public class ExceptionUtils {

    public static  <T extends Throwable> boolean causedBy(Throwable t, Class<T> c) {
        var cause = t;
        while (cause != null) {
            if (cause.getClass().equals(c)) return true;
            cause = cause.getCause();
        }
        return false;
    }
}
